<!--
 * @Author: zhangxiangsheng 1026583651@qq.com
 * @Date: 2024-04-07 14:48:25
 * @LastEditors: xuezhuangzhuang xzz6996@qq.com
 * @LastEditTime: 2025-01-13 20:52:29
 * @FilePath: \crm\pages\index\index.vue
 * @Description: 
 * 
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
-->
<template>
  <view class="content-index"> </view>
</template>

<script>
import { getToken } from "@/config/storage";
import { getUserInfo } from "@/apis/user";
import { setUserInfo } from "@/config/storage";

export default {
  onShow() {
    // 如果没有登录先跳入到登陆页面
    if (getToken()) {
      uni.navigateTo({
        url: "/pagesecharts/index/index",
      });
    } else {
      uni.navigateTo({
        url: "/pagesCalendar/login/login",
      });
    }
  },
  async mounted() {
    if (getToken()) {
      const res = await getUserInfo();
      setUserInfo(res.sysUser)
    }
  },
};
</script>
<style lang="scss" scoped></style>
